﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using BabyFood.Entities;
using BabyFood.Data;

public partial class HomePage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            HienThiQuangCao();
            HienThiQuangCaoLeft();
            if (Request.QueryString["Id"] != null)
            {
                H_CatalogId.Value = Request.QueryString["id"].ToString();                
            }            
        }

    }    

    /// <summary>
    /// Hiển Thị Quảng Cáo right
    /// </summary>
    private void HienThiQuangCao()
    {
        int TotalRows = 0;
        TList<QuangCao> TList_TinTuc = DataRepository.QuangCaoProvider.GetPaged("IdNhomQuangCao=6", "", 0, 0, out TotalRows);
        dlqcright.DataSource = TList_TinTuc;
        dlqcright.DataBind();
    }

    /// <summary>
    /// Hiển Thị Quảng Cáo Left
    /// </summary>
    private void HienThiQuangCaoLeft()
    {
        int TotalRows = 0;
        TList<QuangCao> TList_TinTuc = DataRepository.QuangCaoProvider.GetPaged("IdNhomQuangCao=7", "", 0, 0, out TotalRows);
        dlqcleft.DataSource = TList_TinTuc;
        dlqcleft.DataBind();
    }
}
